import base from './base'
import EndNode from './endNode.vue'

class EndNodeView extends base.view {
	constructor(props) {
		super(props, EndNode)
	}
}

class EndNodeModel extends base.model {
	setAttributes() {
		this.text.editable = false // 禁止节点文本编辑
		// 设置节点宽高和锚点
		const width = 60
		const height = 60
		this.width = width
		this.height = height
		// this.anchorsOffset = [[width / 2, 0], [0, height / 2], [-width / 2, 0], [0, -height / 2],];
	}
	endNodeFlag(){
		return true;
	}
	showCopyNodeIcon() {
		return false
	}

	showAddNodeIcon() {
		return false
	}
	isDrawView() {
		if(this.properties?.component?.groupCode =='endWorkflow'){
			return false
		}
		return true;
	}

	static instanceNode(name) {
		name = name.toLowerCase()
		return name == 'jsonoutput' || name == 'exceloutput' || name == 'endworkflow'
	}
}

export default {
	type: 'end-node',
	model: EndNodeModel,
	view: EndNodeView
}
